let _project = ref []

let project_create_ocaml name =
  _project := "main.ml" :: [];
  let make_files () = 
    let cmd = "cp "^"./templates/main.ml ./"^name^"/main.ml" in  
    let _ = Sys.command cmd in
    print_endline cmd;
    let mFile = open_in "./templates/Makefile" in
    let maFile = open_out ("./"^name^"/Makefile") in
    output_string maFile ("# Makefile Generique\n\nPRG = "^name^"\n");
    try
      while (true) do
        let line = input_line mFile in
        output_string maFile (line^"\n")
      done
    with End_of_file -> close_in mFile;
    close_out maFile;
    _project := "Makefile" :: (name^".proj") :: !_project
  in
  try Unix.mkdir name 0o775; make_files () with Unix.Unix_error (e,_,_) -> make_files ()
